﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Adams.Web.Areas.MyAdams.Logic.Classifieds
{
    public static class Index
    {
        public static MyAdams.Models.Classifieds.Index.PageLoad PageLoad(int memberid)
        {
            return MyAdams.Data.Classifieds.Index.PageLoad(memberid);
        }

        public static Adams.Web.Models.FormOutput Renew(int memberId, int postingId)
        {
            var output = new Adams.Web.Models.FormOutput();
            var expiresOn = DateTime.Now.AddDays(14);
            MyAdams.Data.Classifieds.Index.Renew(memberId, postingId, expiresOn);
            output.ID = postingId;
            output.IsSaved = true;

            return output;
        }

        public static Adams.Web.Models.FormOutput Remove(int memberId, int postingId)
        {
            var output = new Adams.Web.Models.FormOutput();
            MyAdams.Data.Classifieds.Index.Remove(memberId, postingId);
            output.ID = postingId;
            output.IsSaved = true;
            return output;
        }
    }
}